package site.yunnong.atvris.service.repository;

import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.elasticsearch.repository.ElasticsearchRepository;
import org.springframework.stereotype.Repository;
import site.yunnong.atvris.service.domain.EsUser;

/**
 * @author zjh
 * @date 2021/9/30 23:23
 */
@Repository
public interface EsUserRepository extends ElasticsearchRepository<EsUser, Long> {

    /**
     * 根据昵称获取用户列表
     * @param nickname
     * @param pageable
     * @return
     */
    Page<EsUser> findByNickname(String nickname, Pageable pageable);

    /**
     * 根据昵称获取用户列表
     * @param nickname
     * @param pageable
     * @return
     */
    Page<EsUser> findByNicknameOrderById(String nickname, Pageable pageable);
}
